package com.itheima.thread5;

public class Demo02 {

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            Thread t2 = new Thread(() -> {
                for (int i = 0; i < 10000000; i++) {
                    System.out.println(Thread.currentThread().getName()+i);
                }
            });
            t2.setName("我是备胎");
            t2.setDaemon(true);
            t2.start();
            for (int i = 0; i < 1000000; i++) {
                System.out.println(Thread.currentThread().getName()+i);
            }

        });
        t1.setName("姐就是女神");
        t1.setDaemon(true);
        t1.start();
        for (int i = 0; i < 10; i++) {
            Thread.sleep(1);
            System.out.println("main来过了"+i);
        }

    }
}
